import React, { Component } from 'react';
import ReactDOM from 'react-dom';
let { observable, observe, computed, autorun, when, action, spy } = require("mobx");
import { observer } from "mobx-react"

class Todo {
    id = Math.random();
    @observable text = "";
    @observable computed = false;
    constructor(text) {
        this.text = text;
    }
    @action.bound toggle(){
        this.computed = !this.computed;
    }
}
class Store {
    @observable todos = [];
    @action.bound addTodo(text) {
        this.todos.push(new Todo(text))
    }
    @action.bound removeTodo(todo){
        this.todos.remove(todo)
    }
}

export default {
    Todo,
    Store
}